//
//  BetSkillVC.m
//  DaleTou
//
//  Created by anyfish010 on 2018/5/27.
//  Copyright © 2018年 geren. All rights reserved.
//

#import "BetSkillVC.h"
#import "XGConfig.h"
#import "ZXTableView.h"
#import "BetSkillCell.h"
#import "NumberDNAVC.h"
#import "BetSkillDetailVC.h"
#import "BonusCalculatorVC.h"

#define Ktitle1 @"title1"
#define ktitle2 @"title2"
#define kNumber @"number"
#import "Appearance.h"

@interface BetSkillVC ()<UITableViewDelegate,UITableViewDataSource>
@property(nonatomic,strong)ZXTableView *mainTable;
@property(nonatomic,strong)NSMutableArray *mArrTitles;
@end

@implementation BetSkillVC
- (void)viewDidLoad{
    [super viewDidLoad];
    
    [self setNavConfigStartColor:@"#F57321" endColor:@"#F57321"];
    [self ApptitileView:@"投注技巧"];

    _mainTable = [[ZXTableView alloc]initWithFrame:CGRectMake(0, NAV_HEIGHT, ScreenWidth, ScreenHeight- NAV_HEIGHT) style:UITableViewStylePlain];

 

    _mainTable.delegate = self;
    _mainTable.dataSource = self;
    [self.view addSubview:self.mainTable];
    
    if (@available(iOS 11.0, *)) {
        self.mainTable.contentInsetAdjustmentBehavior = UIApplicationBackgroundFetchIntervalNever;
    }else {
        self.automaticallyAdjustsScrollViewInsets = NO;
    }
    
    UIView *headView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenWidth / 750.0 * 320)];
    self.mainTable.tableHeaderView = headView;
    
    UIImageView *imgV = [[UIImageView alloc]initWithFrame:headView.frame];
    imgV.image = [UIImage imageNamed:@"背景2"];
    [headView addSubview:imgV];
    
    NSArray *titles = @[@"大乐透投注技巧 尾数分析选号法",@"大乐透投注技巧 巧用出号规律 关注历史出号总数",@"大乐透分析技巧：前区冷热门数字偏差跟踪系统",@"大乐透投注技巧 排除选号法",@"大乐透投注技巧 几率随机选号法",@"大乐透投注技巧 你不知道的投注方式",@"大乐透投注技巧 投注必看",@"大乐透投注技巧 科学投注技巧",@"大乐透投注技巧 教你这期必中",@"大乐透投注技巧 精彩不容错过",@"大乐透投注技巧 下一个百万赢家",@"大乐透投注技巧 带你进入杀一必中教程",@"大乐透投注技巧 尾数分析选号法"];
    self.mArrTitles = [NSMutableArray arrayWithArray:titles];
    [_mainTable reloadData];
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.mArrTitles.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    BetSkillCell *cell = [[NSBundle mainBundle]loadNibNamed:@"BetSkillCell" owner:nil options:nil].firstObject;
    cell.LabTitle1.text = [_mArrTitles objectAtIndex:indexPath.row];
    cell.labTitle2.text = @"2018-5-25";
    cell.labNum.text = @"3";
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    BetSkillDetailVC *detailVC = [[BetSkillDetailVC alloc]init];
    detailVC.type = indexPath.row%3;
    [self.navigationController pushViewController:detailVC animated:YES];
    

}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 74;
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    return 0.1;
}

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    return 0.1;
}







@end
